package com.${companyName}.${projectName}.dao.${model};

import java.util.List;
import com.${companyName}.${projectName}.common.PagerModel;
import com.${companyName}.${projectName}.common.Query;
import com.${companyName}.${projectName}.model.${model}.${objectName};

<#assign primaryKeyTypeJava="String"/> 
<#if columnFieldList??>  
	<#list columnFieldList as item>
		<#if item.column=='${primaryKeys[0]}' && item.jdbcType=='INTEGER'>
			<#assign primaryKeyTypeJava="Integer"/>
		</#if>
	</#list>
</#if>


/**
 * ${objectNameCn}Dao接口
 * @author ${author}
 * @date ${createTime}
 */
public interface I${objectName}Dao {

	/**
	 * 通过${primaryKeysConvert[0]}得到${objectNameCn}${objectName}
	 * @param ${primaryKeysConvert[0]}
	 * @return 
	 * @throws Exception
	 * @Description:
	 */
	public ${objectName} get${objectName}By${primaryKeyMerger}(${primaryKeyTypeJava} ${primaryKeysConvert[0]}) throws Exception;

	/**
	 * 通过${primaryKeysConvert[0]}s批量得到${objectNameCn}${objectName}
	 * @param ${primaryKeysConvert[0]}s 如：<#if primaryKeyTypeJava="String">"'1','2','3','4'..."<#elseif primaryKeyTypeJava="Integer">"1,2,3,4..."</#if>
	 * @return 
	 * @throws Exception
	 * @Description:
	 */
	public List<${objectName}> get${objectName}By${primaryKeyMerger}s(String ${primaryKeysConvert[0]}s) throws Exception;
	
	/**
	 * 通过${primaryKeysConvert[0]}s批量得到${objectNameCn}${objectName}
	 * @param ${primaryKeysConvert[0]}s 
	 * @return 
	 * @throws Exception
	 * @Description:
	 */
	public List<${objectName}> get${objectName}By${primaryKeyMerger}sList(List<${primaryKeyTypeJava}> ${primaryKeysConvert[0]}s) throws Exception;

	/**
	 * 得到所有${objectNameCn}${objectName}
	 * @param ${fLowerObjectName}
	 * @return 
	 * @throws Exception
	 * @Description:
	 */
	public List<${objectName}> getAll(${objectName} ${fLowerObjectName}) throws Exception;

	/**
	 * 分页查询${objectNameCn}${objectName}
	 * @param ${fLowerObjectName}
	 * @param query
	 * @return
	 * @throws Exception
	 * @Description:
	 */
	public PagerModel<${objectName}> getPagerModelByQuery(${objectName} ${fLowerObjectName}, Query query) throws Exception;
	
	/**
	 * 查询记录数
	 * @param ${fLowerObjectName}
	 * @return
	 * @throws Exception
	 * @Description:
	 */
	public int getByPageCount(${objectName} ${fLowerObjectName})throws Exception ;

	/**
	 * 添加${objectNameCn}${objectName}
	 * @param ${fLowerObjectName}
	 * @throws Exception
	 * @Description:
	 */
	public void insert${objectName}(${objectName} ${fLowerObjectName}) throws Exception;
	
	/**
	 * 批量添加${objectNameCn}${objectName}
	 * @param ${fLowerObjectName}s
	 * @throws Exception
	 * @Description:
	 */
	public void insert${objectName}Batch(List<${objectName}> ${fLowerObjectName}s) throws Exception;

	/**
	 * 通过${primaryKeysConvert[0]}删除${objectNameCn}${objectName}
	 * @param ${primaryKeysConvert[0]}
	 * @throws Exception
	 * @Description:
	 */
	public void del${objectName}By${primaryKeyMerger}(${primaryKeyTypeJava} ${primaryKeysConvert[0]}) throws Exception;
	
	/**
	 * 通过${primaryKeysConvert[0]}批量删除${objectNameCn}${objectName}
	 * @param ${primaryKeysConvert[0]}s 如：<#if primaryKeyTypeJava="String">"'1','2','3','4'..."<#elseif primaryKeyTypeJava="Integer">"1,2,3,4..."</#if>
	 * @throws Exception
	 * @Description:
	 */
	public void del${objectName}By${primaryKeyMerger}s(String ${primaryKeysConvert[0]}s) throws Exception;
	
	/**
	 * 通过${primaryKeysConvert[0]}批量删除${objectNameCn}${objectName}
	 * @param ${primaryKeysConvert[0]}s 
	 * @throws Exception
	 * @Description:
	 */
	public void del${objectName}By${primaryKeyMerger}sList(List<${primaryKeyTypeJava}> ${primaryKeysConvert[0]}s) throws Exception;

	/**
	 * 通过${primaryKeysConvert[0]}修改${objectNameCn}${objectName}
	 * @param ${fLowerObjectName}
	 * @throws Exception
	 * @Description:
	 */
	public int update${objectName}(${objectName} ${fLowerObjectName}) throws Exception;
	
	/**
	 * 通过${primaryKeysConvert[0]}s批量修改${objectNameCn}${objectName}
	 * @param ${primaryKeysConvert[0]}s 如：<#if primaryKeyTypeJava="String">"'1','2','3','4'..."<#elseif primaryKeyTypeJava="Integer">"1,2,3,4..."</#if>
	 * @param ${fLowerObjectName}
	 * @throws Exception
	 * @Description:
	 */
	public int update${objectName}By${primaryKeyMerger}s(String ${primaryKeysConvert[0]}s,${objectName} ${fLowerObjectName}) throws Exception;
	
	/**
	 * 通过${primaryKeysConvert[0]}s批量修改${objectNameCn}${objectName}
	 * @param ${primaryKeysConvert[0]}s 
	 * @param ${fLowerObjectName}
	 * @throws Exception
	 * @Description:
	 */
	public int update${objectName}By${primaryKeyMerger}sList(List<${primaryKeyTypeJava}> ${primaryKeysConvert[0]}s,${objectName} ${fLowerObjectName}) throws Exception;
	
	/**
	 * 通过${primaryKeysConvert[0]}批量修改${objectNameCn}${objectName}
	 * @param ${fLowerObjectName}s
	 * @throws Exception
	 * @Description:
	 */
	public int update${objectName}List(List<${objectName}> ${fLowerObjectName}s) throws Exception;
	
	//------------api------------
}
